package top.psjj.news.dao;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import top.psjj.news.po.TAdmin;
import top.psjj.news.utils.DataSourceUtils;

/**
 * @Auther:小陈的Java
 */
public class AdminDao {
    private QueryRunner queryRunner = new QueryRunner();
    public TAdmin queryAdminByUsernameAndPassword(String username,String password) throws Exception{
        TAdmin result = queryRunner.query(DataSourceUtils.getConnection(),"select * from t_admin where username=? and password=?", new BeanHandler<TAdmin>(TAdmin.class), username, password);
        return result;
    }
}
